package com.example.springbootrocketmq.controller;

import com.example.springbootrocketmq.transaction.SpringTransactionProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: 郭敬仰
 * @Date: 2019/9/5 17:11
 * @Description:
 */
@RestController
public class TestController {
    @Autowired
    private SpringTransactionProducer springTransactionProducer;

    @RequestMapping("/transaction")
    public void transaction() {
        springTransactionProducer.sendMsg("my-transaction-topic", "第1个Spring消息");
    }

    @RequestMapping("/demo")
    public void demo() {
        springTransactionProducer.sendMsg("my-topic", "第2个Spring消息");
    }
}
